package world.snowcrystal.dto;


import jakarta.annotation.Nullable;
import lombok.Data;
import world.snowcrystal.dao.UserAuthenticationDetails;

@Data
public class UsernameAndPasswordDto {

    private Long id;
    private String uuid;

    private String username;
    private String password;
    @Nullable
    private String inPlaceOperationToken;

    public UsernameAndPasswordDto() {}
    public UsernameAndPasswordDto(Long id, String username, String password, String inPlaceOperationToken) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.inPlaceOperationToken = inPlaceOperationToken;
    }

    public static UsernameAndPasswordDto fromNewCreatedUserDetails(UserAuthenticationDetails uad,String inPlaceOperationToken) {
        return new UsernameAndPasswordDto(uad.getId(),uad.getUsername(),uad.getPassword(),inPlaceOperationToken);
    }
}
